package com.yupi.yupao.enums;

/**
 * @Author: Peter
 * @Date: 2024-05-09-16:58
 * @Description: Pe
 */
public enum TeamStatusEnum {
    PUBLIC(0,"公开"),
    PRIVATE(1,"私有"),
    SECRET(2,"加密");

    private int value;
    private String text;

    public static TeamStatusEnum getEnumByValue(Integer value){
        if(value==null){
            return null;
        }
        TeamStatusEnum[] values = TeamStatusEnum.values();//获取枚举
        for (TeamStatusEnum t:values) {//遍历枚举数组
           if(t.getValue()==value){ //比较
            return t;
           }
        }
        return null;
    }


    TeamStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
